<!DOCTYPE html>
<html lang="en">


<style>
.profile-info-name {
	text-align: right;
	padding: 6px 10px 6px 4px;
	font-weight: 400;
	color: #667E99;
	background-color: transparent;
	width: 150px;
	vertical-align: middle
}
.profile-info-name2 {
	text-align: right;
	padding: 6px 10px 6px 4px;
	font-weight: 400;
	color: #667E99;
	background-color: #EDF3F4;
	width: 100px;
	vertical-align: middle
}

.search-media {
	border: 1px solid #ddd;
	margin-top: -1px;
	padding: 12px 12px 12px 12px;
	-webkit-transition: border .1s ease-in-out 0s;
	-o-transition: border .1s ease-in-out 0s;
	transition: border .1s ease-in-out 0s;
	position: relative
}
</style>

<body class="no-skin">

<div class="main-container ace-save-state" id="main-container">

    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- 
				<div class="page-header">
					
				</div>--><!-- /.page-header -->
				<div  class="hidden">
					<input class="col-xs-12 col-sm-10" type="text"  id="form-field-villageId" placeholder="villageId" value="$!{familyAndMemberPO.villageId}" />
					<input class="col-xs-12 col-sm-10" type="text"  id="form-field-familyId" placeholder="familyId" value="$!{familyAndMemberPO.familyId}" />
				</div>
				
				<div class="row">
					<div class="col-sm-12">
						<div class="profile-activity clearfix" id="pkh_detail_title_id">
							<!--<img class="pull-left" alt="Alex Doe's avatar" src="assets/images/avatars/avatar5.png" />-->
							<span class="label label-info size-18-name">编辑贫困户基本信息 </span>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">						
						<form type="post" action="$!{webPath}/basicData/update" id="detailForm" data-toggle="validate" data-alertmsg="false">
						<div class="hidden" >
							<input class="col-xs-12 col-sm-10" type="text"  name="familyId" value="$!{familyAndMemberPO.familyId}" />
							<input class="col-xs-12 col-sm-10" type="text"  name="familyMemeberId" value="$!{familyAndMemberPO.familyMemeberId}" />
							<input class="col-xs-12 col-sm-10" type="text" id="editRowId" name="editRowId" value="$!{editRowId}" />
						
						</div>
						
						<div class="col-xs-12">
							<div class="profile-user-info profile-user-info-striped" style="width: calc(100% );" id="family_info_div" >
								<div class="profile-info-row">
									<div class="profile-info-name"> 镇(乡) </div>
									<div class="profile-info-value">
										<span class="editable" >$!{familyAndMemberPO.townName}</span>
									</div>
									
									<div class="profile-info-name"> 行政村 </div>
									<div class="profile-info-value">
										<span class="editable" >$!{familyAndMemberPO.villageName}</span>
									</div>
									
									<div class="profile-info-name"> 户编号 </div>
									<div class="profile-info-value">
										<input type="hidden" name="familyCode" value="$!{familyAndMemberPO.familyCode}" />
										<span class="editable" >$!{familyAndMemberPO.familyCode}</span>
									</div>
									
								</div>
								<div class="profile-info-row">
									<div class="profile-info-name"> 人编号 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-personCode" name="personCode" value="$!{familyAndMemberPO.personCode}" placeholder="人编号" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 姓名 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-name" name="name" value="$!{familyAndMemberPO.name}" placeholder="姓名" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 性别 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="gender" id="form-field-gender" data-placeholder="是否参加新型养老保险">
											#foreach($dataDict in $genderNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.genderName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
								</div>	
								<div class="profile-info-row">	
									<div class="profile-info-name"> 证件号码 </div>
									<div class="profile-info-value">
										<span class="editable" >$!{familyAndMemberPO.idNumber}</span>
									</div>
									
									<div class="profile-info-name"> 人数 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-personNum" name="personNum" value="$!{familyAndMemberPO.personNum}" placeholder="人数" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 与户主关系 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="masterRel" id="form-field-masterRel" data-placeholder="与户主关系">
											#foreach($dataDict in $masterRelNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.masterRelName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
								</div>	
								<div class="profile-info-row">		
									<div class="profile-info-name"> 民族 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="nation" id="form-field-nation" data-placeholder="民族">
											#foreach($dataDict in $nationNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.nationName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
									
									<div class="profile-info-name"> 文化程度 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="educationLevel" id="form-field-educationLevel" data-placeholder="文化程度">
											#foreach($dataDict in $educationLevelNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.educationLevelName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
									
									<div class="profile-info-name"> 在校生状况 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="studentState" id="form-field-studentState" data-placeholder="在校生状况">
											#foreach($dataDict in $studentStateNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.studentStateName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
								</div>	
								<div class="profile-info-row">	
									<div class="profile-info-name"> 健康状况 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="healthState" id="form-field-healthState" data-placeholder="健康状况">
											#foreach($dataDict in $healthStateNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.healthStateName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
										</select>
									</div>
									
									<div class="profile-info-name"> 劳动技能 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="workSkill" id="form-field-workSkill" data-placeholder="劳动技能">
											#foreach($dataDict in $workSkillNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.workSkillName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
									
									<div class="profile-info-name"> 务工状况 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="workState" id="form-field-workState" data-placeholder="务工状况">
											#foreach($dataDict in $workStateNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.workStateName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
											
										</select>
									</div>
								</div>	
								<div class="profile-info-row">
									
									<div class="profile-info-name"> 务工时间（月） </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-workMonths" name="workMonths" value="$!{familyAndMemberPO.workMonths}" placeholder="务工时间（月）" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 是否参加新农合 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="isNrcms" id="form-field-isNrcms" data-placeholder="是否参加新农合">
											<option value="1"  #if("${familyAndMemberPO.isNrcmsName}"=="是") selected = "selected" #end>是</option>
											<option value="0"  #if("${familyAndMemberPO.isNrcmsName}"=="否") selected = "selected" #end>否</option>
											
										</select>
										
									</div>
									
									<div class="profile-info-name"> 是否参加新型养老保险 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="isEndowment" id="form-field-isEndowment" data-placeholder="是否参加新型养老保险">
											<option value="1"  #if("${familyAndMemberPO.isEndowmentName}"=="是") selected = "selected" #end>是</option>
											<option value="0"  #if("${familyAndMemberPO.isEndowmentName}"=="否") selected = "selected" #end>否</option>
											
										</select>
									</div>
								</div>	
								<div class="profile-info-row">		
									<div class="profile-info-name"> 是否参加城镇职工基本养老保险 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="isCityEndowment" id="form-field-isCityEndowment" data-placeholder="是否参加城镇职工基本养老保险">
											<option value="1"  #if("${familyAndMemberPO.isCityEndowmentName}"=="是") selected = "selected" #end>是</option>
											<option value="0"  #if("${familyAndMemberPO.isCityEndowmentName}"=="否") selected = "selected" #end>否</option>
											
										</select>
									</div>
									
									<div class="profile-info-name"> 脱贫属性 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="povertyState" id="form-field-povertyState" data-placeholder="脱贫属性">
											#foreach($dataDict in $povertyStateNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.povertyStateName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
										</select>
									</div>
									
									<div class="profile-info-name"> 贫困户属性 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="povertyAttr" id="form-field-povertyAttr" data-placeholder="贫困户属性">
											#foreach($dataDict in $povertyAttrNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.povertyAttrName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
										</select>
									</div>
								</div>
								<div class="profile-info-row">
									<div class="profile-info-name"> 主要致贫原因 </div>
									<div class="profile-info-value">
										<select class="chosen-select form-control" name="mainReason" id="form-field-mainReason" data-placeholder="主要致贫原因">
											#foreach($dataDict in $mainReasonNameMap.entrySet())
											   <option value="$dataDict.value"  #if("${familyAndMemberPO.mainReasonName}"=="$dataDict.key") selected = "selected" #end>$dataDict.key</option>
											#end 
										</select>
									</div>
								
									<div class="profile-info-name"> 人均纯收入 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-avgIncome" name="avgIncome" value="$!{familyAndMemberPO.avgIncome}" placeholder="人均纯收入" class="col-xs-12 col-sm-12" />
									</div>
								
									<div class="profile-info-name"> 实际脱贫年度 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-povertyStateDate" name="povertyYear" value="$!dateTool.format('yyyy',$!familyAndMemberPO.povertyStateDate)" placeholder="实际脱贫年度" class="col-xs-12 col-sm-12"  />
									</div>
								
								</div>
								<div class="profile-info-row">
									<div class="profile-info-name"> 开户银行名称 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-bankName" name="bankName" value="$!{familyAndMemberPO.bankName}" placeholder="开户银行名称" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 银行卡号 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-accountCode" name="accountCode" value="$!{familyAndMemberPO.accountCode}" placeholder="银行卡号" class="col-xs-12 col-sm-12" />
									</div>
									
									<div class="profile-info-name"> 联系电话 </div>
									<div class="profile-info-value">
										<input type="text" id="form-field-tel" name="tel" value="$!{familyAndMemberPO.tel}" placeholder="联系电话" class="col-xs-12 col-sm-12" />
									</div>
								</div>
								
							</div>
							
						</div>
						</form>
						
					</div>
				</div>
				
				<div class="row">
					<div class="col-sm-12">
						<div class="profile-activity clearfix" id="pkh_detail_title_id">
							<div class="center col-md-12">
								<button id="submitFormBtn" class="btn btn-info" type="button">
									<i class="ace-icon fa fa-check bigger-110"></i>
									确定
								</button>
								<button id="backBtn" class="btn" type="reset">
									<i class="ace-icon fa fa-undo bigger-110"></i>
									返回
								</button>
							</div>
						</div>
					</div>
				</div>				
				
				<div class="hr hr4 hr-dotted"></div>
				
				
				<!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div>
</div>
<script type="text/javascript" charset="utf-8" src="$!webPath/assets/js/bootstrap-datepicker.min.js"></script>


		<script type="text/javascript">
		
		jQuery(function($) {
			
			
			$('#form-field-povertyStateDate').datepicker({
				language : 'zh-CN',
				format : 'yyyy',
				//startView: 2,  
		        //maxViewMode: 1,
		        //minViewMode:1,
				autoclose: true,
	            todayHighlight: true
	        });
			
			$("#submitFormBtn").on('click',function () {
				$('#detailForm').ajaxSubmit({    
					url:'$!webPath/basicData/updateFamilyDetail',  
					dataType: 'text',
					type : 'POST',
					success: resutlMsg,  
					error: errorMsg  
				});   
				function resutlMsg(rowData){
					console.log($('#editRowId').val());
					jQuery("#family-member-list").jqGrid('setRowData',$('#editRowId').val(),$.parseJSON(rowData));
					
					
					var dialog = $( "#dialog-message" ).removeClass('hide').dialog({
						modal: true,
						buttons: [ 
							
							{
								text: "确定",
								"class" : "btn btn-primary btn-minier",
								click: function() {
									$( this ).dialog( "close" ); 
								} 
							}
						]
					});
					
					$('#familyDetailModal').modal('hide');
					
				}  
				function errorMsg(){   
					$.msgErrorAlert("保存出错!");
					//alert("保存出错！");      
				}  
			});
			
			$("#backBtn").on('click',function () {
				$('#familyDetailModal').modal('hide');
				
			});
			
		});
		</script>

</body>
</html>
